<template>
  <Scroll :hasmore="hasmore" :pullup="pullup" setHeight="-0">
    <ul class='share first-box'>
      <li v-for="item in data">
        <p>姓名：<span>{{item.name}}</span></p>
        <p>电话：<span>{{item.phone}}</span></p>
        <p>分享时间：<span>{{item.time}}</span></p>
        <GreyLine class="line"></GreyLine>
      </li>
    </ul>
  </Scroll>
</template>
<script>
import Scroll from '../../common/scroller'
import GreyLine from '../../common/line.vue'
export default {
  components: {GreyLine,Scroll},
  name: "",
  data() {
    return {
      
      hasmore:false,
      data:[
        // {
        //   name:"敲山老二",
        //   phone:"1234567812",
        //   time:"2018-10-10"
        // },{
        //   name:"敲山老二",
        //   phone:"1234567812",
        //   time:"2018-10-10"
        // }
      ],
      pageInfo:{
        page:1
      }
    };
  },
  methods: {
    pullup(func){
      if(this.hasmore){
        this.pageInfo.page++
         _g.orderList([this.getList,func])
         return
      }
    },
    getList(){
      var params={
        id:sessionStorage.getItem("detailId"),
        currPageNo:this.pageInfo.page,
      }
      _g.apiPost("couponApp/getSharerdUsers.do",params).then(res=>{
        this.hasmore=res.data.hasNextPage
        var goal=[]
        res.data.list.forEach(ele => {
          goal.push({
            // id:ele.id,
            name:ele.realName,
            phone:ele.phone,
            time:ele.getTime.slice(0,10),
          })
        });
        this.$set(this,"data",this.data.concat(goal))
      })
    }
  },
  created() {
    this.getList()
  }
};
</script>
<style lang="scss" scoped>
.share {
  font-size: 14px;
  color: #333;

  li{
    padding-top: 5px;

    p{
      margin: 5px 15px;

      span{
        color: #999;
      }
    }

    .line{
      margin-top: 10px;
    }
  }
}
</style>